(function($) {
Drupal.behaviors.myBehavior = {
  attach: function (context, settings) {

    //code starts
	jQuery('#user-login #edit-actions').append('<a href="contact" class="custom_button">Contact</a>');
	jQuery(function($)
   {
		var url = $('#search-block-form').attr('action');
		
		url = url.substring(0 , url.lastIndexOf('/')+1);
		$('#search-block-form').attr('action' , url);
    //code ends
	});
  }
};
})(jQuery);

jQuery(document).ready(function(){
	/*jQuery('#edit-field-hire-code-und-0-value').attr('disabled' , 'disabled');*/
	jQuery('#block-search-form h2').removeClass("element-invisible");
	jQuery('#block-views-user-view-block h2').removeClass("element-invisible");
	var html_cat = jQuery('.taxonomy-term-reference-0').html();
	if(html_cat != null){
		jQuery('#breadcrumb .breadcrumb').append(' &#187; '+html_cat);
		jQuery('.hierarchical-select-item-separator').html("&#187;")
	}
	
	jQuery('.page-taxonomy.page-taxonomy-term .term-listing-heading').append('<div id="taxo-header"></div>');
	jQuery('.node-sticky.node-teaser').each(function(i){
		jQuery('#taxo-header').append('<div class="cat-doc">'+this.innerHTML+'</div>');
		jQuery(this).remove();
	});
	var tab_1 = jQuery('.views-field.views-field-field-operating-safety .field-content').text();
	var tab_2 = jQuery('.views-field.views-field-field-user-guide .field-content').text();
	var tab_3 = jQuery('.views-field.views-field-field-best-practice .field-content').text();
	var tab_4 = jQuery('.view-relate-content.view-id-relate_content').text();
	if(tab_1 == ''){
		jQuery('#quicktabs-tab-node_detail-1').css('display' , 'none');
	}
	if(tab_2 == ''){
		jQuery('#quicktabs-tab-node_detail-2').css('display' , 'none');
	}if(tab_3 == ''){
		jQuery('#quicktabs-tab-node_detail-3').css('display' , 'none');
	}if(tab_4 == ''){
		jQuery('#quicktabs-tab-node_detail-4').css('display' , 'none');
	}
});

